<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.0.1/echarts.min.js"></script>
    <script src="walden.js"></script>
</head>
<body>
<div id="echarts" style="width: 600px;height:400px"></div>
<script>
    var chartDom = document.getElementById('echarts');
    var myChart = echarts.init(chartDom, 'walden');
    var option;

    option = {
        // 标题
        title:{
            text:'标题',
            textStyle:{
                fontWeight:'normal'
            },
            subtext:'副标题'
        },
        // 提示框
        tooltip:{},
        // 图例
        legend:{
            data:['销量']
        },
        // x 轴
        xAxis: {
            type: 'category',
            data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
        },
        // y 轴
        yAxis: {
            type: 'value'
        },
        series: [{
            name:'销量',
            data: [120, 200, 150, 80, 70, 110, 130],
            type: 'bar'
        }]
    };

    option && myChart.setOption(option);
</script>
</body>
</html>
